-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
health: move to mypy #1620
health: move to mypy #1620
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1620 +/- ##
==========================================
- Coverage 85.07% 85.03% -0.04%
==========================================
Files 113 113
Lines 12661 12658 -3
==========================================
- Hits 10771 10764 -7
- Misses 1890 1894 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; let one minor comment
slack_sdk/models/dialogs/__init__.py
Outdated
placeholder=placeholder, | ||
) | ||
self.min_query_length = min_query_length | ||
|
||
|
||
class DialogBuilder(JsonObject): | ||
attributes = {} # no attributes because to_dict has unique implementation | ||
attributes = set() # no attributes because to_dict has unique implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this property is unused, so changing the type should not affect the behavior. That said, changing from dict to set object may not make sense. This legacy component won't be enhanced anymore but using a set object might be a cause of future bugs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point 💯 it seems like the attribute
property is defined as a set
in the inherited class (JsonObject
), I'm assuming this object overrides this and mypy
does not like it. I've reverted the changes and added an ignore comment for now
We can address these ignore comments later or if they become relevant
Summary
This PR aims to follow the Bolt Pythons #1130
MyPy was found to execute much fast the PyType in this project, these changes adapt the project to use MyPy instead of PyType
From my short experience with mypy:
Note: removing all the type: ignore comments from the project may cause breaking changes or have a ripple effect through the entire project
Testing
Category
/docs
(Documents)/tutorial
(PythOnBoardingBot tutorial)tests
/integration_tests
(Automated tests for this library)Requirements
python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh
after making the changes.